<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>微信登录</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/plugins/bootstrap-4.1.1-dist/css/bootstrap.min.css">
    <script src="/js/plugins/jquery/jquery.min.js"></script>
    <script src="/js/plugins/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css">
    <link rel="stylesheet" href="/css/reset.css">
    <link rel="stylesheet" href="/css/login.css">
    <script src="/js/plugins/qrcode/qrcode.min.js"></script>
    <script>

    </script>

</head>
<body>
<input id="text" type="text" value="https://558f5267.ngrok.io/bindWechat" hidden/><br />
<input id="uuid" type="hidden"/>
<div class="container">
    <h5>微信绑定账号</h5>

    <div class="card card-container " id="qrcode">

    </div>


    <a href="/mine/simpleProfiles.html" class="registerLink">
        返回设置页面
    </a>
</div>
<script type="text/javascript">
    var qrcode = new QRCode(document.getElementById("qrcode"), {
        width : 150,
        height : 150
    });

    function makeCode (url) {
        var elText = document.getElementById("text");
        qrcode.makeCode(url);
    }

/*    makeCode();

    $("#text").
    on("blur", function () {
        makeCode();
    }).
    on("keydown", function (e) {
        if (e.keyCode == 13) {
            makeCode();
        }
    });*/



    $(function () {
        var user = JSON.parse(sessionStorage.getItem('user'));
        console.log(user);
        var url="https://558f5267.ngrok.io/bindWechat?userId="+user.id;
        //初始化二维码
        makeCode(url);
    })
</script>
</body>
</html>
